<?php
$error = false;
if($this->Session->check('process_error')){
    if($this->Session->read('process_error') == 'yes'){
        $error = true;
    }
    $controller->Session->delete('process_error');
}
?>
<?php
$flash_msg = $this->Session->read('Message');
if(isset($flash_msg['flash'])){
    ?>
    <div class="row-fluid">
        <div class="span12">
            <?php
            if($error){
                echo $this->Message->msg('Status',$this->Session->flash(),'error',true);
            }
            else{
                echo $this->Message->msg('Status',$this->Session->flash(),'success',true);
            }
            ?>
        </div>
    </div>
<?php
}
?>
<div class="row-fluid">
    <div class="span4 profile-left">

        <div class="widgetbox profile-photo">
            <div class="headtitle">
                <div class="btn-group">
                    <button data-toggle="dropdown" class="btn dropdown-toggle">Action <span class="caret"></span></button>
                    <ul class="dropdown-menu">
                        <li><a href="#">Change Photo</a></li>
                        <li><a href="#">Remove Photo</a></li>
                    </ul>
                </div>
                <h4 class="widgettitle">Profile Photo</h4>
            </div>
            <div class="widgetcontent">
                <div class="profilethumb">
                    <?php echo $this->Html->image('profilethumb2.png', array('alt' => 'Name of App','class'=>'img-polaroid')); ?>
                </div><!--profilethumb-->
            </div>
        </div>

        <!--<div class="widgetbox profile-notifications">
            <h4 class="widgettitle">How often should I be notified</h4>
            <div class="widgetcontent">
                <p>
                    <input type="checkbox" />Every 5 sec -> Service Reminder <br />
                    <input type="checkbox" />Every 10 sec -> Service Reminder <br />
                    <input type="checkbox" />Every 15 sec -> Service Reminder <br />
                    <input type="checkbox" />Every 30 sec -> Service Reminder <br />
                    <input type="checkbox" />Every 1 min -> Service Reminder <br />
                </p>
                <button type="button" class="btn btn-primary">Change Notification</button> &nbsp;
            </div>
        </div>-->

    </div><!--span4-->

    <div class="span8">
        <?php echo $this->Form->create('User', array('id' => 'form','class'=>'editprofileform'));?>
            <div class="widgetbox login-information">
                <h4 class="widgettitle">Login Information</h4>
                <div class="widgetcontent">
                    <p>
                        <label>Username:</label>
                        <?php echo $this->Form->input('username', array('id' => 'username', 'class' => 'input-xlarge', 'default' => $authUser['username'], 'div' => false, 'label' => false)); ?>
                    </p>
                    <p>
                        <label style="padding:0">Password</label>
                        <?php echo $this->Form->input('password', array('id' => 'password', 'type' => 'password', 'class' => '', 'div' => false, 'label' => false)); ?>
                    </p>
                </div>
            </div>


            <div class="widgetbox personal-information">
                <h4 class="widgettitle">Personal Information</h4>
                <div class="widgetcontent">
                    <p>
                        <label>First Name:</label>
                        <?php echo $this->Form->input('fname', array('id' => 'fname', 'class' => 'input-xlarge', 'value' => $authUser['fname'], 'div' => false, 'label' => false)); ?>
                    </p>
                    <p>
                        <label>Middle Name:</label>
                        <?php echo $this->Form->input('mname', array('id' => 'mname', 'class' => 'input-xlarge', 'value' => $authUser['mname'], 'div' => false, 'label' => false)); ?>
                    </p>
                    <p>
                        <label>Last Name:</label>
                        <?php echo $this->Form->input('lname', array('id' => 'lname', 'class' => 'input-xlarge', 'value' => $authUser['lname'], 'div' => false, 'label' => false)); ?>
                    </p>
                    <p>
                        <label>Email:</label>
                        <?php echo $this->Form->input('email', array('id' => 'email', 'class' => '', 'default' => $authUser['email'], 'div' => false, 'label' => false)); ?>
                    </p>
                    <p>
                        <label>Telephone:</label>
                        <?php echo $this->Form->input('telephone', array('id'=>'telephone', 'value'=>$authUser['telephone'], 'div' => false, 'label' => false)); ?>
                    </p>
                </div>
            </div>

            <p>
                <button type="submit" class="btn btn-primary">Update Profile</button> &nbsp;
                <?php echo $this->Form->input('id', array('type'=>'hidden','id'=>'id', 'value'=>$authUser['id'], 'div' => false, 'label' => false)); ?>
            </p>

        <?php echo $this->Form->end();?>
    </div><!--span8-->
</div><!--row-fluid-->

<!-- URLs -->
<input type="hidden" id="company_save_url" value="<?php echo $this->Html->url(array('controller' => 'User', 'action' => 'update')); ?>" />

<!-- Le Script -->
<?php
    //echo $this->Html->script('scripts/company.js');
?>
